# -*- coding: utf-8 -*-
<%inherit file="/admin.mako"/>
<%def name="include_local_javascript()">
  ${h.javascript_include_tag('/js/ui/votacao.js','/js/yui/datatable-beta-min.js','/js/yui/datasource-beta-min.js','/js/yui/button-min.js','/js/yui/container-min.js')}
</%def>
<%def name="include_local_styles()">
  ${h.stylesheet_link_tag('/js/yui/resources/datatable/skins/sam/datatable.css','/js/yui/resources/button/skins/sam/button.css','/js/yui/resources/container/skins/sam/container.css')}
<style type="text/css">  
  .pn_left {
    float: left;
    width: 85.5%;
    color: black;
  }
  
  .pn_right {
    float: right;
    width: 10.5%;
    margin-top: 35px;
  }
  
  .yui-skin-sam #yui-dt0-table a, a:active, a:visited {
    color: black;
  }
</style>
</%def>

<p style="text-align: center"><span class="destak">Cadastro de Vota&ccedil;&otilde;es</span></p>
${h.form(h.url(action='save',id=c.form_result['cdvotacao']),method='post',id_='votacao_form')}
${h.hidden_field('cdvotacao',value=c.form_result['cdvotacao'] or '')}
${h.hidden_field('cdmostra',value=c.form_result['cdmostra'] or '')}
${h.hidden_field('flativa',value=c.form_result['flativa'] or '0')}
${h.hidden_field('candidate_list',value='')}
<div id="list" class="inner_context">
  <table class="tablelist" width="100%" cellpadding="0" cellmargin="0">    
    <tbody class="ligth_gray">
      <tr>
        <td align="right" width="15%"><strong>Data</strong></td>
        <td width="*">${h.text_field('dtvotacao',class_='ed',size='9',value=h.str_date(c.form_result['dtvotacao']) or '')} (dd/mm/aaaa)</td>
      </tr>
      <tr>
        <td align="right"><strong>Mostra</strong></td>
        <td>${h.text_field('nmmostra',class_='ed',size='50',value=h.get_propertie(c.form_result,'r_mostra.nmmostra') or '')} 
            <a href="javascript:void(0)" id="btfind_mostra">${h.image_tag('edit-find.png',border=0, alt='Procurar Mostra',title='Procurar Mostra')}</a></td>
      </tr>
    </tbody>
  </table>
<table class="tablelist" width="100%" cellpadding="2px" cellmargin="0">    
  <tbody class="ligth_gray">
  <tr>
    <th align="left" width="90%">Candidato</th>
    <th width="*">&nbsp;</th>
  </tr>
  <tr>
    <td align="left">${h.text_field('nmcandidato',class_='ed',size='63',value='')} <a href="javascript:void(0)" id="btfind_candidato">${h.image_tag('edit-find.png',border=0, alt='Procurar Candidato',title='Procurar Candidato')}</a></td>
    <td align="left"><input type="button" id="btadd_candidato" class="bt" value=" Adicionar "/></td>
  </tr>
  </tbody>
</table>
  
<div class="pn_left"><div id="candidate_grid"></div></div>
<div class="pn_right"><input type="button" id="btremove_candidato" class="bt" value=" Remover "/></div>
<div style="clear: both">${h.submit(value=' Salvar ',class_='ed')}</div>

</div>
${h.end_form()}
<br/>
<div id="x-window" style="background-color: #fff; color: black; padding: 0">
 <div class="hd">VotaFAM</div>
 <div class="bd"><div id="x-grid" style="background-color: #fff; color: black; padding: 0"></div></div>
</div>
%if c.candidate_list:
    <script type="text/javascript">Votacao.candidate_edit_data = ${c.candidate_list};</script>
%endif